package com.example.tourpal.model;

import java.io.Serializable;
import java.util.List;

public class Plan implements Serializable, Comparable<Plan> {

	private static final long serialVersionUID = -1287177260588925927L;
	private List<Consume> consumption;
	private String description = "";
	private String endTime;
	private Integer id;
	private String name;// plan name
	private List<Comment> planComments;
	private Integer planOrder = 0;
	private String startTime;
	private Integer ispublic;
	private Integer delFlg = 1;
	
	public Plan() {
	}

	public Plan(List<Consume> consumes, String description, String endTime,
			Integer id, String name, List<Comment> planComments,
			Integer planOrder, String startTime) {
		super();
		this.consumption = consumes;
		this.description = description;
		this.endTime = endTime;
		this.id = id;
		this.name = name;
		this.planComments = planComments;
		this.planOrder = planOrder;
		this.startTime = startTime;
	}

	public Integer getDelFlg() {
		return delFlg;
	}

	public void setDelFlg(Integer delFlg) {
		this.delFlg = delFlg;
	}

	public List<Consume> getConsumes() {
		return consumption;
	}

	public void setConsumes(List<Consume> consumes) {
		this.consumption = consumes;
	}

	public Integer getIspublic() {
		return ispublic;
	}

	public void setIspublic(Integer ispublic) {
		this.ispublic = ispublic;
	}

	public Integer getPlanOrder() {
		return planOrder;
	}

	public void setPlanOrder(Integer planOrder) {
		this.planOrder = planOrder;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getEndTime() {
		return LocalDataLoaderHelp.shortTime(endTime);
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<Comment> getPlanComments() {
		return planComments;
	}

	public void setPlanComments(List<Comment> planComments) {
		this.planComments = planComments;
	}

	public String getStartTime() {
		return LocalDataLoaderHelp.shortTime(startTime);
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}


	@Override
	public String toString() {
		return "Plan [consumption=" + consumption + ", description="
				+ description + ", endTime=" + endTime + ", id=" + id
				+ ", name=" + name + ", planComments=" + planComments
				+ ", planOrder=" + planOrder + ", startTime=" + startTime
				+ ", ispublic=" + ispublic + ", delFlg=" + delFlg + "]";
	}

	@Override
	public int compareTo(Plan plan) {
		return this.planOrder > plan.getPlanOrder() ? 1
				: (this.planOrder < plan.getPlanOrder() ? -1 : 0);
	}

}
